<?php
	require_once($_SERVER["DOCUMENT_ROOT"]."/global.php");
	require_once($_SERVER["DOCUMENT_ROOT"]."/modules/security_mod.php");
	require_once($_SERVER["DOCUMENT_ROOT"]."/modules/channel_mod.php");

	SecurityMod::login();

	$level = $_SESSION["account"]->getLevel();
        $chatLevel = $_SESSION["account"]->getChatLevel();
	if ($level != "Admin" && $chatLevel != 3)
		SecurityMod::logout();

	$chn = ChannelMod::getChannel(v($_REQUEST, "id"));
?>
<html>
<head>
<title><?php echo(SettingsMod::PAGE_TITLE." :: Edit Channel"); ?></title>
<link rel="stylesheet" href="main.css">
</head>
<body>
<center>
<form method="post" action="channel_edit_confirm.php">
<input type="hidden" name="id" value="<?php echo($chn->getId()); ?>" />
<table background="<?php echo(SettingsMod::STATIC_IMAGES)?>/bgd.gif" class="messagestyle" align="center">
<tr>
	<th>Channel name:</th>
        <td><input type="text" name="name" style="width: 100%" value="<?php echo($chn->getName()); ?>" /></td>
</tr>

</table>

<br /><br />
<input type="button" value="Cancel" onclick="history.go(-1);" />
<br /><br />
<input type="submit" value="Update" />

</form>
</center>
</body>
</html>